<?php

namespace App\Http\Controllers;

use App\Models\Goods;
use Illuminate\Http\Request;

class GoodsController extends ApiController
{
    public function list()
    {
        $list = Goods::query()->get();
        return self::returnAjax(['list'=>$list], 200);
    }

    public function detail(Request $request)
    {
        $id = $request['id'];
        $goods = Goods::query()->where('id',$id)->get();
        return self::returnAjax($goods, 200);
    }

}
